// ignore_for_file: file_names, must_be_immutable, constant_identifier_names, slash_for_doc_comments, avoid_unnecessary_containers, prefer_const_constructors, unnecessary_cast, sized_box_for_whitespace, prefer_function_declarations_over_variables, overridden_fields, annotate_overrides, prefer_const_literals_to_create_immutables, unnecessary_null_comparison, deprecated_member_use

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:yc_plugin_learn/base/widget/layout/FFTextButton.dart';

/**全局默认页面配置 */
class DeaultPageConfig {
  /**第一次进入 */
  static Widget? ffFirstLoadingWidget(BuildContext context) {
    return FFTextButton(
      text: "这是假的菊花",
      color: Colors.white,
    );
  }

  /**网络错误 */
  static Widget? ffNetErrorWidget(BuildContext context) {
    return FFTextButton(
      text: "这是网络错误",
    );
  }

  /**空数据 */
  static Widget? ffNoDataWidget(BuildContext context) {
    return FFTextButton(
      text: "这是空数据",
    );
  }

  /**刷新配置 */
  static Widget refreshConfig(BuildContext context, Widget child) {
    return RefreshConfiguration(
      footerTriggerDistance: 15,
      dragSpeedRatio: 0.91,
      headerBuilder: () => MaterialClassicHeader(),
      footerBuilder: () => ClassicFooter(),
      enableLoadingWhenNoData: false,
      enableRefreshVibrate: false,
      enableLoadMoreVibrate: false,
      shouldFooterFollowWhenNotFull: (state) {
        // If you want load more with noMoreData state ,may be you should return false
        return false;
      },
      child: child,
    );
  }
}
